
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __HY4633_H
#define __HY4633_H

#ifdef __cplusplus
extern "C" {
#endif

/* Set Multi-touch as supported */
#if !defined(TS_MONO_TOUCH_SUPPORTED)
#define TS_MULTI_TOUCH_SUPPORTED        0
#endif /* TS_MONO_TOUCH_SUPPORTED */

/* Includes ------------------------------------------------------------------*/
#include "TouchScreen.h"

#if (TOUCH_TYPE == TOUCH_HY4633)

  /* I2C Slave address of touchscreen FocalTech FT5336 */
#define HY4633_I2C_SLAVE_ADDRESS            ((uint8_t)0x70)

  /* Maximum border values of the touchscreen pad */
#define HY4633_MAX_WIDTH                    ((uint16_t)400)     /* Touchscreen pad max width   */
#define HY4633_MAX_HEIGHT                   ((uint16_t)960)     /* Touchscreen pad max height  */


  /* Max detectable simultaneous touches */
#define HY4633_MAX_DETECTABLE_TOUCH         ((uint8_t)0x05)

#define HY4633_ID_REG                  		((uint8_t)0xA6)

#define HY4633_FINGER_NUM                 	((uint8_t)0x02)

#define HY4633_T1_REG                    	((uint8_t)0x03)
#define HY4633_T2_REG                    	((uint8_t)0x09)
#define HY4633_T3_REG                    	((uint8_t)0x0F)
#define HY4633_T4_REG                    	((uint8_t)0x15)
#define HY4633_T5_REG                    	((uint8_t)0x1B)
#define HY4633_T6_REG                    	((uint8_t)0x21)
#define HY4633_T7_REG                    	((uint8_t)0x27)
#define HY4633_T8_REG                    	((uint8_t)0x2D)
#define HY4633_T9_REG                    	((uint8_t)0x33)
#define HY4633_T10_REG                    	((uint8_t)0x39)

void 	Touch_Init(void);
void 	Touch_Reset(void);
UINT8	Touch_ReadVersion(void);
UINT16	Touch_ReadID(void);
UINT8 	Touch_ReadCoord(Coord *coord);

#if (TS_MULTI_TOUCH_SUPPORTED == 1)

void ft5336_TS_GetGestureID(uint16_t DeviceAddr, uint32_t * pGestureId);

void ft5336_TS_GetTouchInfo(uint16_t   DeviceAddr,
                            uint32_t   touchIdx,
                            uint32_t * pWeight,
                            uint32_t * pArea,
                            uint32_t * pEvent);
#endif 

#endif

#ifdef __cplusplus
}
#endif
#endif /* __FT5336_H */


